Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove deprecated and unused PolymorphicAllocator. It has been replaced by PolymorphicArenaAllocator.
Restrict PODVector's Allocator to std::allocator and AMReX's various Arena based allocators. This simplifies the implementation of PODVector, because std::allocator is stateless and Arena based allocators are simple even when it's polymorphic.
Fix a few issues of PODVectors with a PolymorphicArenaAllocator. For example, copy assignment operator should copy the Allocator. Copy constructor should consider the possibility that the other PODVector has a different type of Arena.
Add placeholders for potentially growing and shrinking memory allocation in-place that will be implemented in a follow-up PR.
Update PODVector's growth strategy. Hopefully this helps to reduce the memory consumption.
Always try to grow in-place.
For constructors, assign, operator=, resize & reserve, allocate the specified size without extra capacity.
For push_back & emplace_back, grow the capacity by a factor that is 1.5 by default, when there is need to grow.
For insert, the capacity grows either by a factor that is 1.5 by default or to the new size, whichever is greater, when there is need to grow.